{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 34,
   "id": "initial_id",
   "metadata": {
    "collapsed": true,
    "ExecuteTime": {
     "end_time": "2023-11-25T02:30:14.329905Z",
     "start_time": "2023-11-25T02:30:14.292727300Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": "                            title    address                    tag  \\\n135         【店长推荐】广粤方正3+1房，高层眺望园林  凯旋新世界广粤尊府           满五年,VR看装修,新上   \n1888              誉峰正南单位，高层俯瞰珠江公园         誉峰              满五年,VR看装修   \n2407  央企中海地产 满五年唯一物业  一线公园景观 全新装修     中海观园国际          近地铁,满五年,VR看装修   \n30                 嘉裕公馆 4室2厅 东 东北       嘉裕公馆  近地铁,满两年,VR看装修,新上,随时看房   \n2801             珠江新城网红小区经典户型四房放卖       嘉裕公馆     近地铁,满五年,VR看装修,随时看房   \n...                           ...        ...                    ...   \n1575             广州北站地铁公寓37.98平方米     双赢如家公寓          近地铁,满五年,VR看装修   \n1750             高层采光好！电梯出行，配套齐全，       帝缘花园         满五年,VR看装修,随时看房   \n848                   万虹花园 1室0厅 东       万虹花园              满五年,VR看装修   \n2977                  万虹花园 1室0厅 西       万虹花园         满五年,VR看装修,随时看房   \n2841  低总JIA 单间 面积小 花果山公园地铁口  产权清晰       金联市场     近地铁,满五年,VR看装修,随时看房   \n\n      total_price  unit_price    area orient floor_type house_type  \n135        5300.0      271225  195.41      北        中楼层       3室2厅  \n1888       5030.0      189790  265.03      南        高楼层       4室1厅  \n2407       4300.0      174719  246.11      南        中楼层       4室2厅  \n30         4180.0      199067  209.98    东东北        高楼层       4室2厅  \n2801       4100.0      197249  207.86      北        高楼层       4室2厅  \n...           ...         ...     ...    ...        ...        ...  \n1575         30.0        7899   37.98      东        中楼层       1室1厅  \n1750         30.0        9757   30.75      南        高楼层       1室1厅  \n848          23.0        9825   23.41      东        中楼层       1室0厅  \n2977         21.0       10371   20.25      西        中楼层       1室0厅  \n2841         17.0        8586   19.80      北        高楼层       1室1厅  \n\n[3000 rows x 9 columns]",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>title</th>\n      <th>address</th>\n      <th>tag</th>\n      <th>total_price</th>\n      <th>unit_price</th>\n      <th>area</th>\n      <th>orient</th>\n      <th>floor_type</th>\n      <th>house_type</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>135</th>\n      <td>【店长推荐】广粤方正3+1房，高层眺望园林</td>\n      <td>凯旋新世界广粤尊府</td>\n      <td>满五年,VR看装修,新上</td>\n      <td>5300.0</td>\n      <td>271225</td>\n      <td>195.41</td>\n      <td>北</td>\n      <td>中楼层</td>\n      <td>3室2厅</td>\n    </tr>\n    <tr>\n      <th>1888</th>\n      <td>誉峰正南单位，高层俯瞰珠江公园</td>\n      <td>誉峰</td>\n      <td>满五年,VR看装修</td>\n      <td>5030.0</td>\n      <td>189790</td>\n      <td>265.03</td>\n      <td>南</td>\n      <td>高楼层</td>\n      <td>4室1厅</td>\n    </tr>\n    <tr>\n      <th>2407</th>\n      <td>央企中海地产 满五年唯一物业  一线公园景观 全新装修</td>\n      <td>中海观园国际</td>\n      <td>近地铁,满五年,VR看装修</td>\n      <td>4300.0</td>\n      <td>174719</td>\n      <td>246.11</td>\n      <td>南</td>\n      <td>中楼层</td>\n      <td>4室2厅</td>\n    </tr>\n    <tr>\n      <th>30</th>\n      <td>嘉裕公馆 4室2厅 东 东北</td>\n      <td>嘉裕公馆</td>\n      <td>近地铁,满两年,VR看装修,新上,随时看房</td>\n      <td>4180.0</td>\n      <td>199067</td>\n      <td>209.98</td>\n      <td>东东北</td>\n      <td>高楼层</td>\n      <td>4室2厅</td>\n    </tr>\n    <tr>\n      <th>2801</th>\n      <td>珠江新城网红小区经典户型四房放卖</td>\n      <td>嘉裕公馆</td>\n      <td>近地铁,满五年,VR看装修,随时看房</td>\n      <td>4100.0</td>\n      <td>197249</td>\n      <td>207.86</td>\n      <td>北</td>\n      <td>高楼层</td>\n      <td>4室2厅</td>\n    </tr>\n    <tr>\n      <th>...</th>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n    </tr>\n    <tr>\n      <th>1575</th>\n      <td>广州北站地铁公寓37.98平方米</td>\n      <td>双赢如家公寓</td>\n      <td>近地铁,满五年,VR看装修</td>\n      <td>30.0</td>\n      <td>7899</td>\n      <td>37.98</td>\n      <td>东</td>\n      <td>中楼层</td>\n      <td>1室1厅</td>\n    </tr>\n    <tr>\n      <th>1750</th>\n      <td>高层采光好！电梯出行，配套齐全，</td>\n      <td>帝缘花园</td>\n      <td>满五年,VR看装修,随时看房</td>\n      <td>30.0</td>\n      <td>9757</td>\n      <td>30.75</td>\n      <td>南</td>\n      <td>高楼层</td>\n      <td>1室1厅</td>\n    </tr>\n    <tr>\n      <th>848</th>\n      <td>万虹花园 1室0厅 东</td>\n      <td>万虹花园</td>\n      <td>满五年,VR看装修</td>\n      <td>23.0</td>\n      <td>9825</td>\n      <td>23.41</td>\n      <td>东</td>\n      <td>中楼层</td>\n      <td>1室0厅</td>\n    </tr>\n    <tr>\n      <th>2977</th>\n      <td>万虹花园 1室0厅 西</td>\n      <td>万虹花园</td>\n      <td>满五年,VR看装修,随时看房</td>\n      <td>21.0</td>\n      <td>10371</td>\n      <td>20.25</td>\n      <td>西</td>\n      <td>中楼层</td>\n      <td>1室0厅</td>\n    </tr>\n    <tr>\n      <th>2841</th>\n      <td>低总JIA 单间 面积小 花果山公园地铁口  产权清晰</td>\n      <td>金联市场</td>\n      <td>近地铁,满五年,VR看装修,随时看房</td>\n      <td>17.0</td>\n      <td>8586</td>\n      <td>19.80</td>\n      <td>北</td>\n      <td>高楼层</td>\n      <td>1室1厅</td>\n    </tr>\n  </tbody>\n</table>\n<p>3000 rows × 9 columns</p>\n</div>"
     },
     "execution_count": 34,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import pandas as pd\n",
    "import numpy as np\n",
    "df = pd.read_csv('../static/data/house_info_pre.csv')\n",
    "df.sort_values('total_price', ascending=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 45,
   "outputs": [
    {
     "data": {
      "text/plain": "[{'name': '采光', 'value': 561},\n {'name': '户型', 'value': 447},\n {'name': '三房', 'value': 445},\n {'name': '南向', 'value': 409},\n {'name': '方正', 'value': 364},\n {'name': '楼层', 'value': 334},\n {'name': '两房', 'value': 314},\n {'name': '电梯', 'value': 281},\n {'name': '视野', 'value': 199},\n {'name': '满五', 'value': 195},\n {'name': '花园', 'value': 188},\n {'name': '对流', 'value': 185},\n {'name': '精装修', 'value': 176},\n {'name': '看房', 'value': 161},\n {'name': '精装', 'value': 152},\n {'name': '地铁', 'value': 135},\n {'name': '通风', 'value': 134},\n {'name': '保养', 'value': 134},\n {'name': '小区', 'value': 132},\n {'name': '装修', 'value': 126},\n {'name': '阳台', 'value': 110},\n {'name': '地铁口', 'value': 109},\n {'name': '诚心', 'value': 106},\n {'name': '安静', 'value': 98},\n {'name': '东南', 'value': 98},\n {'name': '拎包', 'value': 97},\n {'name': '此房', 'value': 85},\n {'name': '中层', 'value': 81},\n {'name': '入住', 'value': 79},\n {'name': '无遮挡', 'value': 77},\n {'name': '业主', 'value': 73},\n {'name': '四房', 'value': 63},\n {'name': '大两房', 'value': 62},\n {'name': '开阔', 'value': 62},\n {'name': '楼龄', 'value': 62},\n {'name': '实用', 'value': 58},\n {'name': '双阳台', 'value': 57},\n {'name': '舒适', 'value': 57},\n {'name': '厅出', 'value': 56},\n {'name': '大院', 'value': 50},\n {'name': '两卫', 'value': 50},\n {'name': '号线', 'value': 47},\n {'name': '中高层', 'value': 47},\n {'name': '诚意', 'value': 47},\n {'name': '原装', 'value': 46},\n {'name': '新村', 'value': 44},\n {'name': '配套', 'value': 43},\n {'name': '高层', 'value': 43},\n {'name': '望江', 'value': 43},\n {'name': '便利', 'value': 41}]"
     },
     "execution_count": 45,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from jieba import analyse\n",
    "\n",
    "keyword_list = [','.join(analyse.extract_tags(i, topK=5)) for i in df['title'].values.tolist()]\n",
    "keyword_list = ','.join(keyword_list).split(',')\n",
    "keyword_list = np.array(keyword_list)\n",
    "df_keyword = pd.DataFrame(keyword_list).rename(columns={0: 'word'})\n",
    "df_keyword = df_keyword.groupby('word').value_counts().reset_index().rename(columns={0: 'count'})\n",
    "df_keyword.sort_values('count',ascending=False, inplace=True)\n",
    "[{'name':i[0],'value':i[1]}for i in df_keyword.head(50).values.tolist()]"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2023-11-25T02:54:50.057485Z",
     "start_time": "2023-11-25T02:54:49.722964300Z"
    }
   },
   "id": "996dc2314c25cfab"
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "outputs": [
    {
     "data": {
      "text/plain": "[{'name': '中楼层',\n  'value': [39372,\n   35896,\n   14531,\n   0,\n   36992,\n   32777,\n   0,\n   32911,\n   34439,\n   45279,\n   34954,\n   21071,\n   39880,\n   117568,\n   0]},\n {'name': '低楼层',\n  'value': [40798,\n   35629,\n   9861,\n   0,\n   39285,\n   30919,\n   47716,\n   39946,\n   31500,\n   39963,\n   38757,\n   0,\n   48020,\n   46400,\n   0]},\n {'name': '高楼层',\n  'value': [44526,\n   33614,\n   0,\n   29212,\n   35991,\n   30977,\n   0,\n   35600,\n   29104,\n   54262,\n   42522,\n   54797,\n   39960,\n   0,\n   17703]}]"
     },
     "execution_count": 33,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_mean_unit_price = df.loc[:, ['house_type', 'unit_price', 'floor_type']]\n",
    "floor_type_list = df_mean_unit_price.groupby('floor_type').count().index.tolist()\n",
    "house_type_list = df_mean_unit_price.groupby('house_type').count().index.tolist()\n",
    "data_list = [{'name':i,'value':[df_mean_unit_price[(df_mean_unit_price['floor_type'] == i) & (df_mean_unit_price['house_type'] == j)] for\n",
    "               j in house_type_list]} for i in floor_type_list]\n",
    "data = [{'name':i['name'],'value':[round(j['unit_price'].mean()) if len(j) > 0 else 0 for j in i['value']]} for i in data_list]\n",
    "data"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2023-11-25T02:23:21.740448600Z",
     "start_time": "2023-11-25T02:23:21.672875400Z"
    }
   },
   "id": "5e3a91e2675843c6"
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "outputs": [
    {
     "data": {
      "text/plain": "                           title orient\n0                 万科东荟城 4室1厅 南 北     南北\n1       时代南湾 南北对流 望湖的 过五年唯一 全新未住     东南\n2       贝丽花园 电梯高层 满五唯一 户型方正 南北对流     南北\n3          滨江西君华天汇厅出阳台南向2房 地铁同福西    北东南\n4           满5唯一 南北对流户型 装修好 随时看房     南北\n...                          ...    ...\n2995        华景新城 叠翠居精装修电梯二居改三居户型     东南\n2996    带车位，满五唯一，南北对流，八成四得房率，带车位     东南\n2997       低首付，户型方正实用，阳台望流溪河景色靓丽     东北\n2998  周门小区 周门西街 一梯两户 低层 精装修 拎包入住     南北\n2999         实用大三房 中楼层 光线充足 业主急卖     西南\n\n[3000 rows x 2 columns]",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>title</th>\n      <th>orient</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>万科东荟城 4室1厅 南 北</td>\n      <td>南北</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>时代南湾 南北对流 望湖的 过五年唯一 全新未住</td>\n      <td>东南</td>\n    </tr>\n    <tr>\n      <th>2</th>\n      <td>贝丽花园 电梯高层 满五唯一 户型方正 南北对流</td>\n      <td>南北</td>\n    </tr>\n    <tr>\n      <th>3</th>\n      <td>滨江西君华天汇厅出阳台南向2房 地铁同福西</td>\n      <td>北东南</td>\n    </tr>\n    <tr>\n      <th>4</th>\n      <td>满5唯一 南北对流户型 装修好 随时看房</td>\n      <td>南北</td>\n    </tr>\n    <tr>\n      <th>...</th>\n      <td>...</td>\n      <td>...</td>\n    </tr>\n    <tr>\n      <th>2995</th>\n      <td>华景新城 叠翠居精装修电梯二居改三居户型</td>\n      <td>东南</td>\n    </tr>\n    <tr>\n      <th>2996</th>\n      <td>带车位，满五唯一，南北对流，八成四得房率，带车位</td>\n      <td>东南</td>\n    </tr>\n    <tr>\n      <th>2997</th>\n      <td>低首付，户型方正实用，阳台望流溪河景色靓丽</td>\n      <td>东北</td>\n    </tr>\n    <tr>\n      <th>2998</th>\n      <td>周门小区 周门西街 一梯两户 低层 精装修 拎包入住</td>\n      <td>南北</td>\n    </tr>\n    <tr>\n      <th>2999</th>\n      <td>实用大三房 中楼层 光线充足 业主急卖</td>\n      <td>西南</td>\n    </tr>\n  </tbody>\n</table>\n<p>3000 rows × 2 columns</p>\n</div>"
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_orient = df.loc[:, ['title', 'orient']]\n",
    "df_orient['orient'] = df_orient['orient'].apply(lambda x: x[0])\n",
    "diff_orient_ratio_data_list = df_orient.groupby('orient').count().reset_index().values.tolist()\n",
    "{\n",
    "    'data': [{'name': i[0], 'value': i[1]} for i in diff_orient_ratio_data_list]\n",
    "}"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2023-11-25T01:22:45.360612200Z",
     "start_time": "2023-11-25T01:22:45.352087400Z"
    }
   },
   "id": "3e885c147b1b3a98"
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "outputs": [],
   "source": [
    "df_scatter = df[['area', 'unit_price']].values.tolist()\n",
    "from sklearn.linear_model import LinearRegression\n",
    "import numpy as np\n",
    "\n",
    "data = np.array(df[['area', 'unit_price']].to_numpy())\n",
    "X = data[:, 0].reshape(-1, 1)\n",
    "y = data[:, 1].reshape(-1, 1)\n",
    "\n",
    "reg = LinearRegression().fit(X, y)\n",
    "slope = reg.coef_[0]\n",
    "intercept = reg.intercept_\n",
    "\n",
    "X_fit = np.linspace(X.min(), X.max(), 100)\n",
    "y_fit = slope * X_fit + intercept\n",
    "df_regression_line = pd.DataFrame({'X_fit': X_fit, 'y_fit': y_fit})\n",
    "df_regression_line.to_csv('../static/data/liner_Regression.csv', index=None)"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2023-11-24T08:13:10.917518300Z",
     "start_time": "2023-11-24T08:13:08.184411300Z"
    }
   },
   "id": "33bf3c8c3422f6fb"
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "outputs": [
    {
     "data": {
      "text/plain": "[[0, 0, 19],\n [1, 0, 14],\n [2, 0, 7],\n [0, 1, 91],\n [1, 1, 51],\n [2, 1, 64],\n [0, 2, 2],\n [1, 2, 1],\n [2, 2, 0],\n [0, 3, 0],\n [1, 3, 0],\n [2, 3, 1],\n [0, 4, 266],\n [1, 4, 164],\n [2, 4, 239],\n [0, 5, 148],\n [1, 5, 89],\n [2, 5, 120],\n [0, 6, 0],\n [1, 6, 1],\n [2, 6, 0],\n [0, 7, 179],\n [1, 7, 116],\n [2, 7, 128],\n [0, 8, 380],\n [1, 8, 264],\n [2, 8, 344],\n [0, 9, 19],\n [1, 9, 18],\n [2, 9, 14],\n [0, 10, 93],\n [1, 10, 66],\n [2, 10, 73],\n [0, 11, 1],\n [1, 11, 0],\n [2, 11, 1],\n [0, 12, 11],\n [1, 12, 2],\n [2, 12, 9],\n [0, 13, 1],\n [1, 13, 3],\n [2, 13, 0],\n [0, 14, 0],\n [1, 14, 0],\n [2, 14, 1]]"
     },
     "execution_count": 31,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_heatmap = df[['floor_type', 'house_type', 'title']]\n",
    "floor_type_list = df_heatmap.groupby('floor_type').count().index.tolist()\n",
    "house_type_list = df_heatmap.groupby('house_type').count().index.tolist()\n",
    "data = [[i, j, df_heatmap[\n",
    "    (df_heatmap['floor_type'] == floor_type_list[i]) & (df_heatmap['house_type'] == house_type_list[j])].count()[\n",
    "    'title']] for j in range(len(house_type_list)) for i in range(len(floor_type_list))]"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2023-11-24T09:11:07.735004200Z",
     "start_time": "2023-11-24T09:11:07.661790500Z"
    }
   },
   "id": "357ca3b1b85d58f4"
  },
  {
   "cell_type": "code",
   "execution_count": 57,
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\Administrator\\AppData\\Local\\Temp\\ipykernel_3168\\1097642037.py:3: SettingWithCopyWarning: \n",
      "A value is trying to be set on a copy of a slice from a DataFrame.\n",
      "Try using .loc[row_indexer,col_indexer] = value instead\n",
      "\n",
      "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
      "  df_total_price_under_300['orient'] = df_total_price_under_300['orient'].apply(lambda x:x[0])\n"
     ]
    },
    {
     "data": {
      "text/plain": "                           title   address                 tag  total_price  \\\n44               顺德碧桂园芷兰湾 2室1厅 南  顺德碧桂园芷兰湾        满五年,VR看装修,新上        208.0   \n72                  珠江国际城 3室2厅 南     珠江国际城        满两年,VR看装修,新上        126.0   \n105            高层南向三房，装修保养好，拎包入住    合汇学府名郡        满两年,VR看装修,新上        186.0   \n125                越秀滨海新城 4室2厅 南    越秀滨海新城   满两年,VR看装修,新上,随时看房        265.0   \n171    保利领秀山，高层，南向，视野开阔，证满二，税费低，   保利合锦领秀山    满两年,VR房源,新上,随时看房        115.0   \n...                          ...       ...                 ...          ...   \n2795                金地香山湖 4室2厅 南     金地香山湖           满两年,VR看装修        130.0   \n2817      豪进广场 视野开阔3房 南向看公园 随时看房   碧桂园豪进广场  近地铁,满两年,VR看装修,随时看房        230.0   \n2924       区府板块嫩被对流大三房，带电梯，装修保养好      骏辉雅苑           满两年,VR看装修        186.0   \n2933      金马香颂居，南向，看小区别墅，景光好，无遮挡     金马香颂居       近地铁,满五年,VR看装修        162.0   \n2960  金地香山湖4房   前排看湖   中高楼层  保养好     金地香山湖           满两年,VR看装修        170.0   \n\n      unit_price    area orient floor_type house_type  \n44         20693  100.52      南        高楼层       2室1厅  \n72         10967  114.90      南        高楼层       3室2厅  \n105        16503  112.71      南        高楼层       3室2厅  \n125        24517  108.09      南        高楼层       4室2厅  \n171        10265  112.04      南        高楼层       3室2厅  \n...          ...     ...    ...        ...        ...  \n2795       10496  123.86      南        高楼层       4室2厅  \n2817       22735  101.17      南        高楼层       3室2厅  \n2924       14090  132.01      南        高楼层       3室2厅  \n2933       14247  113.71      南        高楼层       3室2厅  \n2960       12327  137.91      南        高楼层       4室2厅  \n\n[75 rows x 9 columns]",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>title</th>\n      <th>address</th>\n      <th>tag</th>\n      <th>total_price</th>\n      <th>unit_price</th>\n      <th>area</th>\n      <th>orient</th>\n      <th>floor_type</th>\n      <th>house_type</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>44</th>\n      <td>顺德碧桂园芷兰湾 2室1厅 南</td>\n      <td>顺德碧桂园芷兰湾</td>\n      <td>满五年,VR看装修,新上</td>\n      <td>208.0</td>\n      <td>20693</td>\n      <td>100.52</td>\n      <td>南</td>\n      <td>高楼层</td>\n      <td>2室1厅</td>\n    </tr>\n    <tr>\n      <th>72</th>\n      <td>珠江国际城 3室2厅 南</td>\n      <td>珠江国际城</td>\n      <td>满两年,VR看装修,新上</td>\n      <td>126.0</td>\n      <td>10967</td>\n      <td>114.90</td>\n      <td>南</td>\n      <td>高楼层</td>\n      <td>3室2厅</td>\n    </tr>\n    <tr>\n      <th>105</th>\n      <td>高层南向三房，装修保养好，拎包入住</td>\n      <td>合汇学府名郡</td>\n      <td>满两年,VR看装修,新上</td>\n      <td>186.0</td>\n      <td>16503</td>\n      <td>112.71</td>\n      <td>南</td>\n      <td>高楼层</td>\n      <td>3室2厅</td>\n    </tr>\n    <tr>\n      <th>125</th>\n      <td>越秀滨海新城 4室2厅 南</td>\n      <td>越秀滨海新城</td>\n      <td>满两年,VR看装修,新上,随时看房</td>\n      <td>265.0</td>\n      <td>24517</td>\n      <td>108.09</td>\n      <td>南</td>\n      <td>高楼层</td>\n      <td>4室2厅</td>\n    </tr>\n    <tr>\n      <th>171</th>\n      <td>保利领秀山，高层，南向，视野开阔，证满二，税费低，</td>\n      <td>保利合锦领秀山</td>\n      <td>满两年,VR房源,新上,随时看房</td>\n      <td>115.0</td>\n      <td>10265</td>\n      <td>112.04</td>\n      <td>南</td>\n      <td>高楼层</td>\n      <td>3室2厅</td>\n    </tr>\n    <tr>\n      <th>...</th>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n    </tr>\n    <tr>\n      <th>2795</th>\n      <td>金地香山湖 4室2厅 南</td>\n      <td>金地香山湖</td>\n      <td>满两年,VR看装修</td>\n      <td>130.0</td>\n      <td>10496</td>\n      <td>123.86</td>\n      <td>南</td>\n      <td>高楼层</td>\n      <td>4室2厅</td>\n    </tr>\n    <tr>\n      <th>2817</th>\n      <td>豪进广场 视野开阔3房 南向看公园 随时看房</td>\n      <td>碧桂园豪进广场</td>\n      <td>近地铁,满两年,VR看装修,随时看房</td>\n      <td>230.0</td>\n      <td>22735</td>\n      <td>101.17</td>\n      <td>南</td>\n      <td>高楼层</td>\n      <td>3室2厅</td>\n    </tr>\n    <tr>\n      <th>2924</th>\n      <td>区府板块嫩被对流大三房，带电梯，装修保养好</td>\n      <td>骏辉雅苑</td>\n      <td>满两年,VR看装修</td>\n      <td>186.0</td>\n      <td>14090</td>\n      <td>132.01</td>\n      <td>南</td>\n      <td>高楼层</td>\n      <td>3室2厅</td>\n    </tr>\n    <tr>\n      <th>2933</th>\n      <td>金马香颂居，南向，看小区别墅，景光好，无遮挡</td>\n      <td>金马香颂居</td>\n      <td>近地铁,满五年,VR看装修</td>\n      <td>162.0</td>\n      <td>14247</td>\n      <td>113.71</td>\n      <td>南</td>\n      <td>高楼层</td>\n      <td>3室2厅</td>\n    </tr>\n    <tr>\n      <th>2960</th>\n      <td>金地香山湖4房   前排看湖   中高楼层  保养好</td>\n      <td>金地香山湖</td>\n      <td>满两年,VR看装修</td>\n      <td>170.0</td>\n      <td>12327</td>\n      <td>137.91</td>\n      <td>南</td>\n      <td>高楼层</td>\n      <td>4室2厅</td>\n    </tr>\n  </tbody>\n</table>\n<p>75 rows × 9 columns</p>\n</div>"
     },
     "execution_count": 57,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_total_price_under_300 = df[df['total_price']<300]\n",
    "df_total_price_under_300['orient'] = df_total_price_under_300['orient'].apply(lambda x:x[0])\n",
    "df_orient_south = df_total_price_under_300[df_total_price_under_300['orient'] == '南']\n",
    "df_area_between_100_and_150 = df_orient_south[(df_orient_south['area']>100)&(df_orient_south['area']<150)]\n",
    "df_High_floors = df_area_between_100_and_150[df_area_between_100_and_150['floor_type'] == '高楼层']"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2023-11-25T03:22:04.234715700Z",
     "start_time": "2023-11-25T03:22:04.211303200Z"
    }
   },
   "id": "de3c0d8f24efb917"
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
